import 'dart:convert';

QuestionGroupResult questionGroupResultFromJson(String str) =>
    QuestionGroupResult.fromJson(json.decode(str));
String questionGroupResultToJson(QuestionGroupResult data) =>
    json.encode(data.toJson());
QuestionGroupsResult questionGroupsResultFromJson(String str) =>
    QuestionGroupsResult.fromJson(json.decode(str));
String questionGroupsResultToJson(QuestionGroupsResult data) =>
    json.encode(data.toJson());
QuestionGroup questionGroupFromJson(String str) =>
    QuestionGroup.fromJson(json.decode(str));
String questionGroupToJson(QuestionGroup data) => json.encode(data.toJson());
QuestionGroupDto questionGroupDtoFromJson(String str) => QuestionGroupDto.fromJson(json.decode(str));
String questionGroupDtoToJson(QuestionGroupDto data) => json.encode(data.toJson());

class QuestionGroupDto {
    QuestionGroupDto({
        this.bookId,
        this.commitTime,
        this.description,
        this.descriptionTraditional,
        this.detail,
        this.editorDetail,
        this.id,
        this.image,
        this.kind,
        this.level,
        this.platform,
        this.schoolId,
        this.scope,
        this.title,
        this.titleTraditional,
        this.type,
    });

    String? bookId;
    int? commitTime;
    String? description;
    String? descriptionTraditional;
    List<Detail>? detail;
    List<EditorDetail>? editorDetail;
    String? id;
    String? image;
    String? kind;
    int? level;
    String? platform;
    String? schoolId;
    String? scope;
    String? title;
    String? titleTraditional;
    String? type;

    factory QuestionGroupDto.fromJson(Map<String, dynamic> json) => QuestionGroupDto(
        bookId: json["bookId"],
        commitTime: json["commitTime"],
        description: json["description"],
        descriptionTraditional: json["descriptionTraditional"],
        detail: json["detail"]!=null ?List<Detail>.from(json["detail"].map((x) => Detail.fromJson(x))): null,
        editorDetail: json["editorDetail"]!=null ? List<EditorDetail>.from(json["editorDetail"].map((x) => EditorDetail.fromJson(x))): null,
        id: json["id"],
        image: json["image"],
        kind: json["kind"],
        level: json["level"],
        platform: json["platform"],
        schoolId: json["schoolId"],
        scope: json["scope"],
        title: json["title"],
        titleTraditional: json["titleTraditional"],
        type: json["type"],
    );

    Map<String, dynamic> toJson() => {
        "bookId": bookId,
        "commitTime": commitTime,
        "description": description,
        "descriptionTraditional": descriptionTraditional,
        "detail": detail!=null ? List<dynamic>.from(detail!.map((x) => x.toJson())): null,
        "editorDetail": editorDetail!=null ? List<dynamic>.from(editorDetail!.map((x) => x.toJson())): null,
        "id": id,
        "image": image,
        "kind": kind,
        "level": level,
        "platform": platform,
        "schoolId": schoolId,
        "scope": scope,
        "title": title,
        "titleTraditional": titleTraditional,
        "type": type,
    };
}

class QuestionGroupResult {
  QuestionGroupResult({
    this.status,
    this.message,
    this.result,
  });

  int? status;
  String? message;
  QuestionGroup? result;

  factory QuestionGroupResult.fromJson(Map<String, dynamic> json) =>
      QuestionGroupResult(
        status: json["status"],
        message: json["message"],
        result: json["result"] != null
            ? QuestionGroup.fromJson(json["result"])
            : null,
      );

  Map<String, dynamic> toJson() => {
        "status": status,
        "message": message,
        "result": result != null ? result?.toJson() : null,
      };
}

class QuestionGroupsResult {
  QuestionGroupsResult({
    this.limit,
    this.page,
    this.count,
    this.list,
  });

  int? limit;
  int? page;
  int? count;
  List<QuestionGroup>? list;

  factory QuestionGroupsResult.fromJson(Map<String, dynamic> json) =>
      QuestionGroupsResult(
        limit: json["limit"],
        page: json["page"],
        count: json["count"],
        list: json["list"] != null
            ? List<QuestionGroup>.from(
                json["list"].map((x) => QuestionGroup.fromJson(x)))
            : null,
      );

  Map<String, dynamic> toJson() => {
        "limit": limit,
        "page": page,
        "count": count,
        "list": list != null
            ? List<dynamic>.from(list!.map((x) => x.toJson()))
            : null,
      };
}

class QuestionGroup {
  QuestionGroup({
    this.bookId,
    this.commitTime,
    this.description,
    this.descriptionTraditional,
    this.detail,
    this.editorDetail,
    this.id,
    this.image,
    this.kind,
    this.level,
    this.platform,
    this.schoolId,
    this.scope,
    this.title,
    this.titleTraditional,
    this.type,
  });

  String? bookId;
  int? commitTime;
  String? description;
  String? descriptionTraditional;
  List<Detail>? detail;
  List<EditorDetail>? editorDetail;
  String? id;
  String? image;
  String? kind;
  int? level;
  String? platform;
  String? schoolId;
  String? scope;
  String? title;
  String? titleTraditional;
  String? type;

  factory QuestionGroup.fromJson(Map<String, dynamic> json) => QuestionGroup(
        bookId: json["bookId"],
        commitTime: json["commitTime"],
        description: json["description"],
        descriptionTraditional: json["descriptionTraditional"],
        detail: json["detail"] != null
            ? List<Detail>.from(json["detail"].map((x) => Detail.fromJson(x)))
            : null,
        editorDetail: json["editorDetail"] != null
            ? List<EditorDetail>.from(
                json["editorDetail"].map((x) => EditorDetail.fromJson(x)))
            : null,
        id: json["id"],
        image: json["image"],
        kind: json["kind"],
        level: json["level"],
        platform: json["platform"],
        schoolId: json["schoolId"],
        scope: json["scope"],
        title: json["title"],
        titleTraditional: json["titleTraditional"],
        type: json["type"],
      );

  Map<String, dynamic> toJson() => {
        "bookId": bookId,
        "commitTime": commitTime,
        "description": description,
        "descriptionTraditional": descriptionTraditional,
        "detail": detail != null
            ? List<dynamic>.from(detail!.map((x) => x.toJson()))
            : null,
        "editorDetail": editorDetail != null
            ? List<dynamic>.from(editorDetail!.map((x) => x.toJson()))
            : null,
        "id": id,
        "image": image,
        "kind": kind,
        "level": level,
        "platform": platform,
        "schoolId": schoolId,
        "scope": scope,
        "title": title,
        "titleTraditional": titleTraditional,
        "type": type,
      };
}

class Detail {
  Detail({
    this.introduction,
    this.partType,
    this.questionIds,
  });

  String? introduction;
  String? partType;
  List<String>? questionIds;

  factory Detail.fromJson(Map<String, dynamic> json) => Detail(
        introduction: json["introduction"],
        partType: json["partType"],
        questionIds: json["questionIds"] != null
            ? List<String>.from(json["questionIds"].map((x) => x))
            : null,
      );

  Map<String, dynamic> toJson() => {
        "introduction": introduction,
        "partType": partType,
        "questionIds": questionIds != null
            ? List<dynamic>.from(questionIds!.map((x) => x))
            : null,
      };
}

class EditorDetail {
  EditorDetail({
    this.page,
    this.questionId,
    this.showSolution,
  });

  int? page;
  String? questionId;
  bool? showSolution;

  factory EditorDetail.fromJson(Map<String, dynamic> json) => EditorDetail(
        page: json["page"],
        questionId: json["questionId"],
        showSolution: json["showSolution"],
      );

  Map<String, dynamic> toJson() => {
        "page": page,
        "questionId": questionId,
        "showSolution": showSolution,
      };
}
